home *** CD-ROM | disk | FTP | other *** search
- Path: peer-news.britain.eu.net!strath-cs!abrown
- From: abrown@cs.strath.ac.uk (Andrew Brown)
- Newsgroups: comp.lang.c
- Subject: Pointer to int
- Date: 13 Mar 1996 19:17:03 GMT
- Organization: Computer Science Dept., Strathclyde University., Glasgow, Scotland.
- Sender: abrown@cs.strath.ac.uk (Andrew G Brown CES92)
- Distribution: world
- Message-ID: <4i76vf$58v@dunlop.cs.strath.ac.uk>
- NNTP-Posting-Host: muir-01.cs.strath.ac.uk
-
- I have a function that takes as a parameter a pointer to an int. Is it
- possible to pass the address of a constant directly to the function?
-
- eg.
-
- If the function is defined as ...
-
- int function( int * ptr );
-
- could I call it with something like ...
-
- x = function( &1000 );
-
- where 1000 is the constant to which I want ptr to reference.
-
- Many thanks
-
- Andrew Brown.
-